﻿using SharpKit.JavaScript;
using System;

namespace SharpKit.Onx
{
    /// <summary>
    /// The notifications component centralizes all UI functionality. It also serves as a factory for the various shell objects.
    /// https://www.onx.ms/#apiPage/notifications
    /// </summary>
    [JsType(Mode = JsMode.Prototype, Export = false)]
    public class Notifications : Emitter
    {
        //No way to new this up
        private Notifications()
        { }

        #region Actions (Methods)
        /// <summary>
        /// Creates a new 'notification' message displayed on the device's status bar
        /// </summary>
        /// <param name="title">short title for the new notification</param>
        /// <returns>newly created notification object</returns>
        [JsMethod(Name = "createNotification")]
        public Notification CreateNotification(string title)
        { return null; }
        #endregion

    }

    /// <summary>
    /// Represents a notification to the user, it's displayed in the device's status bar.
    /// </summary>
    [JsType(Mode = JsMode.Prototype, Export = false)]
    public class Notification
    {
        //No way to new this up
        private Notification()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        [JsProperty(Name = "content", NativeField = true)]
        public string Content { get; set; }

        /// <summary>
        /// Displays the message to the user.
        /// </summary>
        [JsMethod(Name = "show")]
        public void Show()
        { }

        /// <summary>
        /// trigger is received when the user clicks on the notification's UI element.
        /// </summary>
        public event Action Click
        {
            [JsMethod(Name = "on", InsertArg0 = "'click'")]
            add
            {
            }
            [JsMethod(Name = "removeListener", InsertArg0 = "'click'")]
            remove
            {
            }
        }
    }
}